Digital image compression and decompression

ABSTRACT

A method of compressing a digital image defined by a plurality of pixel values in each of one or more channels includes adjusting each pixel value in each of the one or more channels by an average pixel value for that channel. The method further includes splitting each adjusted channel into one or more image blocks, and converting each image block into a frequency block that is a frequency-domain representation of that image block.

BACKGROUND

Digital images are used for a variety of different purposes. Relativelylarge digital images, which have high resolutions, can occupysignificant quantities of disc space. Therefore, digital compressiontechniques which can compress digital image data with only acceptablesacrifices in quality are beneficial.

SUMMARY

Accordingly, methods for compressing a digital image are disclosed.According to some aspects of the disclosure, a digital image isconverted into a frequency-domain representation of the digital image.Before the conversion, an average of the values in each channel of thedigital image is calculated and used to offset the input values to afrequency domain converter. According to another aspect of thedisclosure, the frequency-domain representation of the digital image isquantized by a scaled quantization table that yields only quantizedcoefficients small enough to be represented using a predetermined numberof bits.

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter. Furthermore,the claimed subject matter is not limited to implementations that solveany or all disadvantages noted in any part of this disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an exemplary process flow for a digital image codec inaccordance with an embodiment of the present disclosure.

FIG. 2 somewhat schematically shows color space conversion between anRGB color space and a shift-efficient color space in accordance with anembodiment of the present disclosure.

FIG. 3A shows the RGB components of an exemplary 16×16 digital image asrepresented in the RGB color space.

FIG. 3B shows the red color channel of the digital image of FIG. 3A.

FIG. 3C shows the green color channel of the digital image of FIG. 3A.

FIG. 3D shows the blue color channel of the digital image of FIG. 3A.

FIG. 4A shows a luminance channel as color-space converted from the RGBdigital image of FIG. 3A.

FIG. 4B shows a first chrominance channel as color-space converted fromthe RGB digital image of FIG. 3A.

FIG. 4C shows a second chrominance channel as color-space converted fromthe RGB digital image of FIG. 3A.

FIG. 5A somewhat schematically shows downsampling the first chrominancechannel of FIG. 4B in accordance with an embodiment of the presentdisclosure.

FIG. 5B somewhat schematically shows downsampling the second chrominancechannel of FIG. 4C in accordance with an embodiment of the presentdisclosure.

FIG. 6 somewhat schematically shows adjusting each pixel value in achannel by the average pixel value for that channel in accordance withan embodiment of the present disclosure.

FIG. 7 somewhat schematically shows converting an 8×8 image block to an8×8 frequency block in accordance with an embodiment of the presentdisclosure.

FIGS. 8A-8D show example channel-specific quantization tables inaccordance with an embodiment of the present disclosure.

FIG. 9 somewhat schematically shows quantizing an 8×8 frequency blockusing a scaled, channel-specific quantization table in accordance withan embodiment of the present disclosure.

FIG. 10 shows an example computing system configured to execute thedigital image codec illustrated in FIG. 1.

DETAILED DESCRIPTION

A codec for digital images is disclosed. The disclosed ZTC codec, as itis referred to herein, may be used for compressing and decompressingdigital images for virtually any purpose. The ZTC codec is particularlywell suited for compressing and decompressing textures and/or otherdigital images used in games or other computer-rendered virtualenvironments.

Games and other virtual-environment applications have drasticallyincreased the amount and size of textures and images that are used toconstruct increasingly larger, more-complex, and/or more realisticvirtual environments. Often times, the data used to represent suchtextures and images is transferred to local memory from a removablemedium or from a remote server via a network, and this transfer canserve as a bottleneck in the rendering of the virtual environment.Accordingly, decreasing the amount of data used to represent thetextures or images can mitigate, if not eliminate, the effects of such abottleneck.

Furthermore, once transferred, the data is decompressed, which can becomputationally expensive. Therefore, decompression calculations thatare efficient on a given platform can further mitigate potentialbottlenecks.

As described in more detail below, the ZTC codec tightly compresses datain a manner that facilitates fast, real-time, decompression. The ZTCcodec is configured to handle standard image formats as well as reducedbit depth images, texture compression, alpha channels, normal maps, andarbitrary data images. The ZTC codec is believed to achieve tightercompression ratios than other known image codecs (e.g., JPEG) by atleast 10-20%, especially at higher quality settings. Also, the ZTC codecis believed to achieve 33% tighter compression ratios than other texturecompression formats on real game textures, for an overall ratio of about1:25. It is believed that the ZTC codec may achieve approximately 1:100compression ratios while maintaining a good level of quality.

FIG. 1 shows an example process flow 10 for the ZTC codec. Theillustrated process flow includes various different methods forcompressing a digital image defined by a plurality of pixel values ineach of one or more channels. At 12, process flow 10 includes convertingthe digital image from one or more initial channels (e.g., RGB) to ashift-efficient color space having a luminance channel (Y_(z)), a firstchrominance channel (U_(z)), and a second chrominance channel (V_(z)).The shift-efficient color space facilitates efficient decompression byeliminating multiplications and reducing bit shifts when compared toother color spaces, such as conventional YUV. Using bit shifts duringdecompression can increase performance and/or facilitate hardwareexecution of the algorithm.

As the luminance channel (Y_(z)), the first chrominance channel (U_(z)),and the second chrominance channel (V_(z)) are constituent elements ofthe shift-efficient color space, the RGB color space includes a redcolor channel (R_(I)), a green color channel (G_(I)), and a blue colorchannel (B_(I)).

Conversions from the RGB color space to the shift-efficient color spacecan be performed using the following calculations (e.g., as an initialstep of compression):

$Y_{z} = {{\frac{21}{72}R_{I}} + {\frac{21}{36}G_{I}} + {\frac{63}{504}B_{I}}}$$U_{z} = {{\frac{4}{7}\left( {B_{I} - Y_{z}} \right)} + 128}$$V_{z} = {{\frac{2}{3}\left( {R_{I} - Y_{z}} \right)} + 128.}$

Conversions from the shift-efficient color space back to the RGB colorspace can be performed using the following calculations (e.g., aftercompression as part of decompression):U _(z) =U _(z)−128V _(z) =V _(z)−128R _(I) =Y _(z)+(((V _(z)<<1)+V _(z)+(1<<0))>>1)G _(I) =Y _(z)−((((U _(z)<<1)+U _(z))+((V _(z)<<2)+(V_(z)<<1))+(1<<2))>>3)B _(I) =Y _(z)+(((U _(z)<<3)−U _(z)+(1<<1))>>2)

As can be seen above, the shift-efficient color space is configured toconvert back to the RGB color space without multiplications and withfour or fewer bit shifts for each color channel.

FIG. 2 schematically shows conversions between the RGB color space andthe shift-efficient color space. An example pixel 14 of a digital imageas represented in the RGB color space and a corresponding example pixel14′ as represented in the shift-efficient color space is shown. Pixel 14may include a red value, a green value, a blue value, and optionally analpha value, a data image value, and/or one or more other values (notshown or described for simplification). Pixel 14′ may include aluminance value, a first chrominance value, a second chrominance value,and optionally an alpha value, a data image value, and/or one or moreother values (not shown). While shown using the exemplary colorconversion equations described above, it is to be understood that othercolor conversion equations that provide a shift-efficient color spaceare within the spirit of this disclosure.

FIG. 2 shows only a single pixel of a digital image. However, digitalimages may include virtually any number of pixels, with more pixelsresulting in more detailed, high-resolution images. For purposes ofsimplicity, the following disclosure will use a 16×16 image as anexample.

FIG. 3A shows an example 16×16 image 16 as represented in the RGB colorspace. The image includes a pixel matrix having eight rows and eightcolumns for a total of 256 pixels. In this disclosure, the left-mostcolumn is identified with an index of 0, and the right-most column isidentified with an index of 7, with all intermediate columns beingincremented accordingly (i.e., 0, 1, 2, 3, 4, 5, 6, 7 from left toright). Similarly, the upper-most row is identified with an index of 0,and the lower-most row is identified with an index of 7, with allintermediate rows being incremented accordingly (i.e., 0, 1, 2, 3, 4, 5,6, 7 from top to bottom). As such, the top left pixel can be identifiedas Pixel [0,0], for example. This convention is used throughout thisdisclosure.

Each pixel in FIG. 3A includes a red value (top value in cell), a greenvalue (middle value in cell), and a blue value (bottom value in cell).As an example, Pixel [0, 0] includes a red value of 115, a green valueof 119, and a blue value of 131. For purposes of simplicity, alphavalues, data values, and all other pixel values are not shown in FIG.3A.

As shown in FIGS. 3B-3D, the pixel values from the various colorchannels can be isolated with other pixel values from the same channel.For example, FIG. 3B shows a red color channel 18 corresponding to image16 from FIG. 3A. Likewise, FIG. 3C shows a green color channel 20, andFIG. 3D shows a red color channel 22.

FIGS. 4A-4C respectively show a luminance channel 24, a firstchrominance channel 26, and a second chrominance channel 28, asconverted from image 16 from FIG. 3A using the above described colorconversion equations.

Turning back to FIG. 1, at 30, process flow 10 optionally includesdownsampling the first chrominance channel and the second chrominancechannel. As used herein, downsampling is used to refer to any techniquethat effectively reduces the amount of information in a channel. Asnonlimiting examples, downsampling may include subsampling, averaging,filtering, and/or binning. Downsampling may be executed to virtually anyextent without departing from the spirit of this disclosure. It isbelieved that a 2×2 reduction is appropriate in many situations (e.g.,downsampling a 16×16 channel to a 8×8 channel).

Downsampling reduces the total data required to describe an image.Because human eyes are much better at detecting changes in luminance asopposed to changes in color, the chrominance channels can be downsampledwithout significantly affecting how a human will perceive an image. Whendecompressing the image, the chrominance channels can be upsampled usingany desired technique to facilitate color conversion back to the RGBcolor space.

Continuing with the example started with FIG. 3A, FIG. 5A shows adownsampled, 8×8 first chrominance channel 32, and FIG. 5B shows adownsampled, 8×8 second chrominance channel 34. In the illustratedembodiment, the color channels are subsampled by skipping every-othercolumn and every-other row of chrominance values.

Turning back to FIG. 1, at 36, process flow 10 includes determining anaverage pixel value for the luminance channel, an average pixel valuefor the first chrominance channel, and an average pixel value for thesecond chrominance channel. As explained below, each channel isseparately transformed into a frequency-domain representation of thechannel (e.g., using a two-dimensional, type II, discrete cosinetransform). Before applying the discrete cosine transform to eachchannel, the average of all pixels for a given channel may be taken andused to center the cosine transform to enable better compression for lowcontrast or lower bit images. In other words, image statistics are usedto calculate a suitable offset for the cosine transformation. As anon-limiting example, image statistics can be taken of the whole imageor a suitable subregion (e.g., a 32×32 block) and used to offset adiscrete cosine transform. Offsetting the discrete cosine transformenables better compression overall for lower contrast or lowerbit-per-pixel images and/or regions of images. As an example, theaverage of first chrominance channel 32 from FIG. 5A is 115.

At 38 of FIG. 1, process flow 10 includes adjusting each pixel value ineach of one or more channels (e.g., Y_(z), U_(z), and V_(z)) by anaverage pixel value for that channel. In other words, the average pixelvalue for all pixel values in a channel may be individually subtractedfrom each pixel value in that channel. Continuing with the example ofFIG. 5A, FIG. 6 shows an adjusted first chrominance channel 40 in whicheach subsampled chrominance value of first chrominance channel 32 isreduced by the average value 42 (e.g., 115) of the first chrominancechannel 32.

Turning back to FIG. 1, at 44, process flow 10 includes splitting eachadjusted channel into one or more image blocks. As a nonlimitingexample, each channel may be operatively split into one or more 8×8matrices, depending on the overall size of the channel. The 16×16luminance channel 24 of FIG. 4A may be split into four 8×8 matrices(after adjustment), and the adjusted 8×8 first chrominance channel 40 ofFIG. 6 may be split into one 8×8 matrix. That is, because adjusted firstchrominance channel 40 is already an 8×8 matrix, the adjusted firstchrominance channel is an image block 46. As explained in more detailbelow, splitting each channel into one or more image blocks (e.g., 8×8image blocks) facilitates downstream processing, including conversioninto a frequency-domain representation of the image block.

At 48 of FIG. 1, process flow 10 includes converting each image blockinto a frequency block that is a frequency-domain representation of thatimage block. As one example, this may include performing atwo-dimensional, type II, discrete cosine transform on each image block(e.g., each 8×8 image block). FIG. 7 shows an example frequency block 50transformed from image block 46 of FIG. 6 using a two-dimensional, typeII, discrete cosine transform.

Transforming the image block into a frequency block facilitates datacompression. In particular, after the transformation, the low frequencycomponents of the image reside in the upper-left corner of the matrix(e.g., Pixel [0, 0]). The high frequency components reside in thelower-right corner of the matrix (e.g., Pixel [7, 7]). Because the lowfrequency components are more noticeable to a human eye, the highfrequency information can be compressed and/or eliminated withoutaffecting overall image quality to the same extent as if the lowfrequency information were eliminated.

Accordingly, at 52 of FIG. 1, process flow 10 includes quantizing eachfrequency block into a quantized block including a plurality ofquantized coefficients using channel-specific quantization tables, whichmay be scaled, as described below. Each 8×8 frequency block may bequantized using one of four specific quantization tables. FIG. 8A showsan example luminance-channel quantization table 54 at 50% quality; FIG.8B shows an example chrominance-channel quantization table 56 at 50%quality; FIG. 8C shows an example alpha-channel quantization table 58 at50% quality; and FIG. 8D shows an example data-image quantization table60 at 50% quality.

The quality of these tables may be set on a 0-100% sliding scale,according to the following algorithm:

{ if (iQuality < 1)  iQuality = 1; if (iQuality > 99)  iQuality = 99;double q =  (iQuality < 50) ? (5000.0/(double)iQuality) : (200.0 −2.0*iQuality); for (INT i=0; i<TABLE_SIZE; i++)  {  pTableOut[i] =(int)(((double)pTableIn[i] * q + 50.0) / 100.0);  if (pTableOut[i] == 0)pTableOut[i] = 1;  if (pTableOut[i] > 255) pTableOut[i] = 255;  } }.

Quantization is carried out by dividing each component in the frequencyblock by a corresponding value for that component from the relevantquantization table and rounding to the nearest integer. Quantization mayresult in many of the higher frequency components being rounded to zero,and many of those components that are not rounded to zero being roundedto small positive or negative numbers, which take relatively fewer bitsto store.

FIG. 9 shows an example in which a 98% quality chrominance-channelquantization table 56′ is applied to frequency block 50 from FIG. 7. Thequantization results in a quantized block 62. As can be seen in thisexample, much of the high frequency information is reduced or eliminatedvia quantization.

Returning briefly to FIG. 1, at 64, process flow 10 includes scaling achannel-specific quantization table for each channel to yield onlyquantized coefficients small enough to be represented using apredetermined number of bits (e.g., a signed 8 bit number) when thechannel-specific quantization table is applied to frequency blocks forthat color channel.

As shown at 66 of FIG. 1, scaling the channel-specific quantizationtable for each channel may include testing a default channel-specificquantization table for each channel to determine if the defaultchannel-specific quantization table yields only quantized coefficientssmall enough to be represented using the predetermined number of bits.If the default channel-specific quantization table yields only quantizedcoefficients small enough to be represented using the predeterminednumber of bits, then the default channel-specific quantization table canbe used for that channel. If the default channel-specific quantizationtable does not yield only quantized coefficients small enough to berepresented using the predetermined number of bits, then anytransformation coefficients from the default channel-specificquantization table that yield quantized coefficients too large to berepresented using a predetermined number of bits can be adjusted to forman updated channel-specific quantization table. The updatedchannel-specific quantization table can then be used for that channel.

Such table scaling may be carried out using the following algorithm:

for (DWORD i=0; i<ZTC_DCT_BLOCK; i++) { if ((minDct[i]/QuantTable[i]) <−127 || (maxDct[i]/QuantTable[i]) > 127)  {  QuantTable[i] =(max(abs(minDct[i]), abs(maxDct[i]))/127) + 1;  } }.In other words, all values in the quantization table are incrementedsufficiently large enough to result in corresponding quantizedcoefficients that are a desired size.

Returning to FIG. 9, Quantized Coefficient [1, 0] of quantized block 62is 137, and thus cannot be represented using a signed 8 bit number. As aresult, quantization table 56′ is scaled to quantization table 56″ bychanging Value [0, 1] from 1 to 2. As a result, quantized block 62′ hasa Quantized Coefficient [1, 0] of 68, which can be represented by asigned 8 bit number. Because all quantized coefficients of quantizedblock 62′ can be represented by a signed 8 bit number, no furtherscaling is carried out.

Returning to FIG. 1, at 70, process flow 10 includes progressivelyoutputting a buffer of quantized coefficients having a same index ineach quantized block. In other words, all of the [0, 0] quantizedcoefficients from all of the 8×8 quantized blocks of a color channel areoutput into a buffer, in a progressive sequence, and then all of the [0,1] quantized coefficients are appended to the sequence of the [0, 0]quantized coefficients.

The quantized coefficients may be progressively output in a zig-zagorder starting with low-frequency quantized coefficients andincrementing to high-frequency quantized coefficients. For example, thequantized coefficients may be output in the following order: [0, 0], [0,1], [1, 0], [2, 0], [1, 1], [0, 2], [0, 3], [1, 2], [2, 1], [3, 0], [4,0], . . . [5, 7], [6, 7], [7,6], [7,7].

If all commonly indexed values from all quantized blocks have a zerovalue, those zero values can be effectively skipped. Such a sequence ofzeroes can be flagged and not included in the buffer stream. Single bitalpha channels may be treated differently. The 8 bit original alpha maybe converted to 1 bit using thresholding, error diffusion, patterns, orby other suitable technique, and packed in a bit-field.

Quantized coefficients output as described above are compatible with runlength encoding and/or lossless compression. At 72 of FIG. 1, processflow 10 includes run length encoding the buffer. The buffer may becompressed by using an marker (e.g., “−128”) as the start of a run of atleast three consecutive equal values. In such cases, the next valueafter the marker is the length, followed by the value to be repeated.For example, the following sequence may be run length encoded asindicated: [−1][0][0][1][1][1][1][0]→RLE→[−1][0][0][−128][4][1][0]. Thismethod prevents the final RLE'd data from growing.

While the above quantization has been described only with respect to thefirst chrominance channel, it is to be understood that each channel maybe similarly processed.

This process results in run length encoded, progressively quantizedcoefficients for each channel, along with some header information (e.g.,number of channels, type of channels, quantization table per channel,width, height, magic value, etc.). This format can be further compressedwith virtually any entropy codec, as indicated at 74 of FIG. 1. Becausegames and other virtual environment applications often use losslessentropy codecs to compress all data on the disc or streamed via thenetwork, the same lossless codec that is used to compress the other datacan be used to compress the ZTC image data. In essence, this allows theZTC image data to be compressed without paying the computational cost ofan additional lossless decoding step present in other image compressioncodecs. However, the data provided by ZTC optionally may be furthercompressed with a lossless codec to achieve even tighter compressionratios.

When using the above described ZTC codec, a natural texture streamingpipeline can be built for run-time mip-map generation. It is believedthat generating mip-maps during run-time may save an additional 33% ofspace.

While the ZTC codec has been described with respect to imagecompression, those skilled in the art of image compression anddecompression will appreciate that the data resulting from the abovedescribed compression process may be decompressed by reversing the stepsdescribed above.

In some embodiments, the above described methods and processes may betied to a computing system. As an example, FIG. 10 schematically shows acomputing system 80 that may perform one or more of the above describedmethods and processes. Computing system 80 includes a logic subsystem 82and a data-holding subsystem 84. Computing system 80 may optionallyinclude a display subsystem and/or other components not shown in FIG.10.

Logic subsystem 82 may include one or more physical devices configuredto execute one or more instructions. For example, the logic subsystemmay be configured to execute one or more instructions that are part ofone or more programs, routines, objects, components, data structures, orother logical constructs. Such instructions may be implemented toperform a task, implement a data type, transform the state of one ormore devices, or otherwise arrive at a desired result. The logicsubsystem may include one or more processors that are configured toexecute software instructions. Additionally or alternatively, the logicsubsystem may include one or more hardware or firmware logic machinesconfigured to execute hardware or firmware instructions. The logicsubsystem may optionally include individual components that aredistributed throughout two or more devices, which may be remotelylocated in some embodiments.

Data-holding subsystem 84 may include one or more physical devicesconfigured to hold data and/or instructions executable by the logicsubsystem to implement the herein described methods and processes. Whensuch methods and processes are implemented, the state of data-holdingsubsystem 84 may be transformed (e.g., to hold different data).Data-holding subsystem 84 may include removable media and/or built-indevices. Data-holding subsystem 84 may include optical memory devices,semiconductor memory devices, and/or magnetic memory devices, amongothers. Data-holding subsystem 84 may include devices with one or moreof the following characteristics: volatile, nonvolatile, dynamic,static, read/write, read-only, random access, sequential access,location addressable, file addressable, and content addressable. In someembodiments, logic subsystem 82 and data-holding subsystem 84 may beintegrated into one or more common devices, such as an applicationspecific integrated circuit or a system on a chip.

FIG. 10 also shows an aspect of the data-holding subsystem in the formof computer-readable removable media 86, which may be used to storeand/or transfer data and/or instructions executable to implement theherein described methods and processes.

When included, display subsystem 88 may be used to present a visualrepresentation of data held by data-holding subsystem 84 (e.g., anuncompressed digital image or texture). As the herein described methodsand processes change the data held by the data-holding subsystem, andthus transform the state of the data-holding subsystem, the state ofdisplay subsystem 88 may likewise be transformed to visually representchanges in the underlying data (e.g., a compressed digital image ortexture). Display subsystem 88 may include one or more display devicesutilizing virtually any type of technology. Such display devices may becombined with logic subsystem 82 and/or data-holding subsystem 84 in ashared enclosure, or such display devices may be peripheral displaydevices.

It is to be understood that the configurations and/or approachesdescribed herein are exemplary in nature, and that these specificembodiments or examples are not to be considered in a limiting sense,because numerous variations are possible. The specific routines ormethods described herein may represent one or more of any number ofprocessing strategies. As such, various acts illustrated may beperformed in the sequence illustrated, in other sequences, in parallel,or in some cases omitted. Likewise, the order of the above-describedprocesses may be changed.

The subject matter of the present disclosure includes all novel andnonobvious combinations and subcombinations of the various processes,systems and configurations, and other features, functions, acts, and/orproperties disclosed herein, as well as any and all equivalents thereof.

The invention claimed is:
 1. A method of compressing a digital imagedefined by a plurality of pixel values in each of one or more channels,the method comprising: splitting each channel into one or more imageblocks; converting each image block into a frequency block that is afrequency-domain representation of that image block; scaling achannel-specific quantization table for each channel to yield onlyquantized coefficients small enough to be represented using apredetermined number of bits when the channel-specific quantizationtable is applied to frequency blocks for that color channel; andquantizing each frequency block into a quantized block including aplurality of quantized coefficients using the channel-specificquantization tables.
 2. The method of claim 1, where scaling thechannel-specific quantization table for each channel includes testing adefault channel-specific quantization table for each channel todetermine if the default channel-specific quantization table yields onlyquantized coefficients small enough to be represented using thepredetermined number of bits; and if the default channel-specificquantization table yields only quantized coefficients small enough to berepresented using the predetermined number of bits, then using thedefault channel-specific quantization table for that channel; or if thedefault channel-specific quantization table does not yield onlyquantized coefficients small enough to be represented using thepredetermined number of bits, then adjusting any transformationcoefficients from the default channel-specific quantization table thatyielded quantized coefficients too large to be represented using apredetermined number of bits to form an updated channel-specificquantization table, and using the updated channel-specific quantizationtable for that channel.
 3. The method of claim 1, where the one or morechannels are constituent elements of a shift-efficient color spacehaving a luminance channel, a first chrominance channel, and a secondchrominance channel; and where the method further includes convertingthe digital image from an RGB color space to the shift-efficient colorspace.
 4. The method of claim 3, where the RGB color space includes ared color channel (R_(I)), a green color channel (G_(I)), and a bluecolor channel (B_(I)), and where the luminance channel (Y_(z)) isconverted as:$Y_{z} = {{\frac{21}{72}R_{I}} + {\frac{21}{36}G_{I}} + {\frac{63}{504}B_{I}}}$the first chrominance channel (U_(z)) is converted as:$U_{z} = {{\frac{4}{7}\left( {B_{I} - Y_{z}} \right)} + 128}$ and thesecond chrominance channel (V_(z)) is converted as:$V_{z} = {{\frac{2}{3}\left( {R_{I} - Y_{z}} \right)} + 128.}$
 5. Themethod of claim 3, further comprising determining an average pixel valuefor the luminance channel, an average pixel value for the firstchrominance channel, and an average pixel value for the secondchrominance channel, and adjusting each pixel value in each channel bythe average pixel value for that channel before converting each imageblock into a frequency block.
 6. The method of claim 1, where convertingeach image block into a frequency block that is a frequency-domainrepresentation of that image block includes performing atwo-dimensional, type II, discrete cosine transform on each image block.7. A method of compressing a digital image defined by a plurality ofpixel values in each of one or more initial channels, the methodcomprising: converting the digital image from the one or more initialchannels to a shift-efficient color space having a luminance channel, afirst chrominance channel, and a second chrominance channel;downsampling the first chrominance channel and the second chrominancechannel; determining an average pixel value for the luminance channel,an average pixel value for the first chrominance channel, and an averagepixel value for the second chrominance channel; adjusting each pixelvalue in each channel by the average pixel value for that channel;splitting each channel, as adjusted, into one or more image blocks;converting each image block into a frequency block that is afrequency-domain representation of that image block; scaling achannel-specific quantization table for each channel to yield onlyquantized coefficients small enough to be represented using apredetermined number of bits when the channel-specific quantizationtable is applied to frequency blocks for that color channel; andquantizing each frequency block into a quantized block including aplurality of quantized coefficients using the channel-specificquantization tables.
 8. The method of claim 7, where the one or moreinitial channels includes a red color channel (R_(I)), a green colorchannel (G_(I)), and a blue color channel (B_(I)); where the luminancechannel (Y_(z)) is converted as:$Y_{z} = {{\frac{21}{72}R_{I}} + {\frac{21}{36}G_{I}} + {\frac{63}{504}B_{I}}}$where the first chrominance channel (U_(z)) is converted as:$U_{z} = {{\frac{4}{7}\left( {B_{I} - Y_{z}} \right)} + 128}$ and wherethe second chrominance channel (V_(z)) is converted as:$V_{z} = {{\frac{2}{3}\left( {R_{I} - Y_{z}} \right)} + 128.}$
 9. Themethod of claim 7, where the shift-efficient color space is configuredto convert to a RGB color space without multiplications and with five orfewer bit shifts for each color channel.
 10. The method of claim 7,where downsampling the first chrominance channel and the secondchrominance channel includes one or more of subsampling, averaging,filtering, and binning.
 11. The method of claim 7, where splitting eachchannel, as adjusted, into one or more image blocks includes splittingeach channel into one or more 8×8 matrices.
 12. The method of claim 7,where converting each image block into a frequency block that is afrequency-domain representation of that image block includes performinga two-dimensional, type II, discrete cosine transform on each imageblock.
 13. The method of claim 7, further comprising progressivelyoutputting a buffer of quantized coefficients having a same index ineach quantized block, the quantized coefficients being progressivelyoutput in a zig-zag order starting with low-frequency quantizedcoefficients and incrementing to high-frequency quantized coefficientswhile skipping quantized coefficients having a zero value if allcommonly indexed values from all quantized blocks also have a zerovalue.
 14. The method of claim 13, further comprising run lengthencoding the buffer.